package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.ArticlePageQueryDTO;
import com.sky.vo.AnnouncementsVO;
import com.sky.vo.ArticleChildCommentVo;
import com.sky.vo.ArticleInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 贾晓晨
 * @version 1.0
 */
@Mapper
public interface HomeMapper {
    @Select("select category_name from categories")
    List<String> getTagList();

    Page<ArticleInfoVO> getArticleList(ArticlePageQueryDTO articlePageQueryDTO);

    @Select("select count(*) as article_count from articles_info ")
    Integer getArticleCount();

    @Select("select count(*) as article_count from website_list where status = 1 and is_deleted = 0")
    Integer getRadioCount();

    @Select("select count(*) as comment_count from comments order by create_Time desc limit 10")
    Integer getCommentCount();

    @Select("select * from announcements")
    List<AnnouncementsVO> getNewinformation();

    @Select("select * from comments order by create_Time desc limit 10")
    List<ArticleChildCommentVo> getNewComments();
}
